From: Florian Müllner Date: Fri, 22 Nov 2024 18:23:59 +0000 (+0100) Subject: loginDialog: Split out getBannerText() helper X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~173^2^2~3 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f328eee88c4e700a29625e87fd6fc997a138c66b;p=gnome-shell.git loginDialog: Split out getBannerText() helper The new methods will make it easier to add alternative sources for the banner text. Part-of: --- diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 27baae83a..c3c397c0d 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -873,11 +873,18 @@ export const LoginDialog = GObject.registerClass({ this._authPrompt.cancelButton.visible = cancelVisible; } + _getBannerText() { + const enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY); + if (!enabled) + return null; + + return this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY); + } + _updateBanner() { - let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY); - let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY); + const text = this._getBannerText(); - if (enabled && text) { + if (text) { this._bannerLabel.set_text(text); this._bannerLabel.show(); } else {